import axios from "@/api/request"

const fastdfs = {
    delete: 'file/fastdfs/delete'
}
const user = {
    update: "/front/user/update",
    findById: '/front/user/findById',
    findAll: '/front/user/findAll',
    loginPassword: "/front/user/loginPassword",
    sendLoginCheckCode: '/front/user/sendLoginCheckCode',
    loginCheckCode: '/front/user/loginCheckCode',
    sendMessage: '/front/user/sendMessage',
    registerCheckCode: '/front/user/registerCheckCode',
    register: '/front/user/register',
    getUserByToken: "/front/user/getUser",
    findByUserName: "/front/user/findByUserName",

}
const bookUserCollect = {
    add: "/front/bookUserCollect/add",
    delete: "/front/bookUserCollect/delete",
    findAllByUserId: "/front/bookUserCollect/findAllByUserId",
    deleteByUserIdAndBookId: "/front/bookUserCollect/deleteByUserIdAndBookId",
    isCorrect: "/front/bookUserCollect/isCorrect",
}
const api = {
    fastdfs_delete(params) {
        return axios.delete(fastdfs.delete, {params})
    },
    user_update(params) {
        return axios.post(user.update, params)
    },
    user_loginPassword(params) {
        return axios.post(user.loginPassword, params)
    },
    user_sendLoginCheckCode(params) {
        return axios.get(user.sendLoginCheckCode, {params})
    },
    user_loginCheckCode(params) {
        return axios.post(user.loginCheckCode, params)
    },
    user_sendMessage(params) {
        return axios.get(user.sendMessage, {params})
    },
    user_registerCheckCode(params) {
        return axios.get(user.registerCheckCode, {params})
    },
    user_register(params) {
        return axios.post(user.register, params)
    },
    user_getUserByToken(params) {
        return axios.get(user.getUserByToken, {params})
    },
    user_findByUserName(params) {
        return axios.get(user.findByUserName, {params})
    },
    user_findById(params) {
        return axios.get(user.findById, {params})
    },
    user_findAll(params) {
        return axios.get(user.findAll, {params})
    },

    bookUserCollect_add(params) {
        return axios.post(bookUserCollect.add, params)
    },
    bookUserCollect_delete(params) {
        return axios.delete(bookUserCollect.delete, {params})
    },
    bookUserCollect_findAllByUserId(params) {
        return axios.get(bookUserCollect.findAllByUserId, {params})
    },
    bookUserCollect_deleteByUserIdAndBookId(params) {
        return axios.delete(bookUserCollect.deleteByUserIdAndBookId, {params})
    },
    bookUserCollect_isCorrect(params) {
        return axios.get(bookUserCollect.isCorrect, {params})
    },
}
export default api
